package com.qfedu.scode.service.impl;

import com.qfedu.scode.dao.StudentDao;
import com.qfedu.scode.entity.Student;
import com.qfedu.scode.service.intf.StudentService;
import com.qfedu.scode.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @program: StartCoding
 * @description:
 * @author: Feri(邢朋辉)
 * @create: 2021-01-05 11:21
 */
@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentDao dao;

    @Override
    public R save(Student student) {
        if(student!=null){
            if(dao.save(student)>0){
                return R.ok();
            }
        }
        return R.fail("新增异常");
    }

    @Override
    public R queryAll() {
        return R.ok(dao.selectAll());
    }
}
